require.config({
  paths:{
    jquery:'../assets/jquery-3.2.1.min',
    methods:'../js/methods',
    yun:'../js/yun',
    layui:'../assets/layui/layui',
    plugin:'../js/plugin',
    bs:['../assets/bootstrap/js/bootstrap.min','https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min']
  },
  shim:{
    plugin:['jquery'],
    bs:['jquery']
  }
});
require(['jquery','layui','methods','plugin','yun','bs'],yun);
function yun($) {
  var arr=['cjj','cjy','cxx'];
  $.each(arr,function (index,item) {
    // console.log(item);
  });
  (function () {
    var lis=$('.img-list').find('li');
    var liCss=[ //z-index,tx,scale,opacity,index,class
      [8,-180,0.7,1,-2,''],
      [9,-100,0.8,1,-1,''],
      [10,0,1,1,0,'on'],
      [9,100,0.8,1,1,''],
      [8,180,0.7,1,2,'']
    ];
    function changeLi() {
      $.each(lis,function (ind) {
        $(this).removeClass('on').css({
          transform:'translateX('+liCss[ind][1]+'px) scale('+liCss[ind][2]+')',
          "-webkit-transform":'translateX('+liCss[ind][1]+'px) scale('+liCss[ind][2]+')',
          "-ms-transform":'translateX('+liCss[ind][1]+'px) scale('+liCss[ind][2]+')',
          zIndex:liCss[ind][0],
          opacity:liCss[ind][3]
        }).attr('index',liCss[ind][4]).addClass(liCss[ind][5]);
      });
    }
    changeLi();
    lis.on('click',function () {
      var index=$(this).attr('index');
      if(index<0){
        for (var i=0;i<-index;i++){
          liCss.push(liCss.shift());
        }
      }else if(index>0){
        for (i=0;i<index;i++){
          liCss.unshift(liCss.pop());
        }
      }
      changeLi();
    });
  })();

  $('.tab-box').yunTab({
    click:function (e) {
      console.log(this,e);
    }
  });
  $(window).on('scroll',throttle(function () {
    // console.log(1);
  },100));

  layui.use(['layer','form'],function(){
    var layer=layui.layer;
    var form = layui.form;

    //监听提交
    form.on('submit(formDemo)', function(data){
      layer.msg(JSON.stringify(data.field));
      return false;
    });


  });

}